package cn.sgjk.train.business.req;

import cn.sgjk.train.common.req.PageReq;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

@Data
public class DailyTrainTicketQueryReq extends PageReq implements Serializable {


    private String trainCode;

    private String start;

    private String end;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date date;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DailyTrainTicketQueryReq that = (DailyTrainTicketQueryReq) o;
        return Objects.equals(trainCode, that.trainCode) && Objects.equals(start, that.start)
                && Objects.equals(end, that.end) && Objects.equals(date, that.date)
                && Objects.equals(getSize(), that.getSize()) && Objects.equals(getPage(), that.getPage());
    }

    @Override
    public int hashCode() {
        return Objects.hash(trainCode, start, end, date,getPage(),getSize());
    }

    @Override
    public String toString() {
        return "DailyTrainTicketQueryReq{" +
                "} " + super.toString();
    }
}
